// 导入 DB
const db = require('../utils/DB');
var Schema = db.mongoose.Schema;

// 创建 tested 模型
var TestedSchema = db.mongoose.Schema({
    studentId: {   // 所属学员 _id
        type: Schema.Types.ObjectId,
        ref: 'studentsModel'
    },
    testId: {  // 关联试卷 _id
        type: Schema.Types.ObjectId,
        ref: 'testsModel'
    },
    score: { type: String }, // 成绩
}, { versionKey: false });

// Tested Modle
var Tested = db.mongoose.model('tested', TestedSchema)

// 函数导出
module.exports = Tested;